package cn.edu.ctbu.shiyan06.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import org.hibernate.validator.constraints.Range;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 针对Student的实体类
 */
@Data
@Entity(name = "students")
public class Student {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    /**
     * 学号
     */
    @NotNull
    @Size(min = 10,max = 10,message = "学号应为10位")
    private String numbers;
    /**
     * 姓名
     */
    @NotNull
    @Size(min = 2,max = 10,message = "姓名应在2个字到10个字之间")
    private String name;
    /**
     * 密码
     */
    @NotNull
    @Size(min = 6,max = 15,message = "姓名应在6个字符到15个字符之间")
    private String password;
    /**
     * 保密：0；男：1；女：2
     */
    private String sex;
    /**
     * 年龄
     */
    @NotNull
    @Range(min = 15,max = 28)
    private Integer age;
    /**
     * 成绩
     */
    @Range(min = 0,max = 100)
    private Integer score;

}